/**
 * Copyright (c) 2010 icer He <icerhe@gmail.com>
 */
package com.icerhe.trigger;

import com.icerhe.trigger.task.AlarmTask;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.util.Log;

/**
 * @author icer
 *
 */
public class SnoozeReceiver extends BroadcastReceiver {

	/* (non-Javadoc)
	 * @see android.content.BroadcastReceiver#onReceive(android.content.Context, android.content.Intent)
	 */
	@Override
	public void onReceive(Context context, Intent intent) {
		Log.d(Consts.TAG, "SnoozeReceiver start");
		int taskId = intent.getIntExtra(AlarmTask.SNOOZE_ID, -1);
		if (taskId>0) {
			AlarmTask task = (AlarmTask)TaskHelper.getCronTaskById(context, taskId);
			task.runTask(context);
		}
	}

}
